package com.team.employment.web.app.custom.config;

import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import org.springdoc.core.models.GroupedOpenApi;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;

@Configuration
@Profile("app")
public class Knife4jConfiguration {

    @Bean
    public OpenAPI customOpenAPI() {

        return new OpenAPI().info(
                new Info()
                        .title("前台管理系统API")
                        .version("1.0")
                        .description("前台管理系统API"));
    }
    @Bean
    public GroupedOpenApi publicApi() {
        return GroupedOpenApi.builder()
                .group("前台接口")
                .pathsToMatch("/app/**") // 确保匹配前台路径
                .packagesToExclude("/admin/**") //排除后台路径
                .build();
    }
    @Bean
    public GroupedOpenApi userAPI() {

        return GroupedOpenApi.builder().group("用户管理模块").
                pathsToMatch(
                        "/app/userAction/**",
                        "/app/userResume/**"
                ).
                build();
    }

    @Bean
    public GroupedOpenApi companyAPI() {

        return GroupedOpenApi.builder().group("企业管理模块").
                pathsToMatch(
                    "/app/companyAction/**",
                    "/app/companyRecruitment/**"
                ).
                build();
    }



    @Bean
    public GroupedOpenApi policyAPI() {

        return GroupedOpenApi.builder().group("政策信息管理模块").
                pathsToMatch(
                        "/app/policyInfo/**"
                ).build();
    }

    @Bean
    public GroupedOpenApi communalAPI() {
        return GroupedOpenApi.builder().group("公共数据模块").
                pathsToMatch(
                    "/app/mixture/**"

                ).build();
    }

}